Index: swfobject_api.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/swfobject_api/swfobject_api.module,v
retrieving revision 1.2.2.9
diff -u -r1.2.2.9 swfobject_api.module
--- swfobject_api.module	20 Mar 2008 23:57:22 -0000	1.2.2.9
+++ swfobject_api.module	17 Jun 2008 18:52:10 -0000
@@ -88,7 +88,7 @@
   $base_params = array(
     'width' => '100%',
     'height' => '100%',
-    'no_flash' => t('Sorry, you need to install flash to see this content.'),
+    'no_flash' => t('Sorry, you need to install flash and turn on JavaScript to see this content.'),
     'version' => variable_get('swfoa_version', '5'),
     'type' => 'movie',
     'bg_color' => '#FFFFFF'
@@ -129,8 +129,12 @@
   // add the parameters
   if ($params) {
     $script[] = 'var params = {';
+    $i = 1;
     foreach ($params as $key => $value) {
-       $script [] = "  $key: '$value',";
+      $val = "  $key: '$value'";
+      $val .= ($i < count($params))? ", ": ""; 
+      $script [] = $val;
+      $i++;
     }
     $script[] ='};';
   }
@@ -138,8 +142,12 @@
   // add the flashvars
   if ($vars) {
     $script[] = 'var flashvars = {'; 
+    $i = 1;
     foreach ($vars as $key => $value) {
-      $script[] = "  $key: '$value',";
+      $val = "  $key: '$value'";
+      $val .= ($i < count($vars))? ", ": ""; 
+      $script [] = $val;
+      $i++;
     }
     $script[] = "};";
   }
@@ -150,8 +158,12 @@
   // add the attributes
   if ($attributes) {
     $script[] = 'var attributes = {'; 
+    $i = 1;
     foreach ($attributes as $key => $value) {
-      $script[] = "  $key: '$value',";
+      $val = "  $key: '$value'";
+      $val .= ($i < count($attributes))? ", ": ""; 
+      $script [] = $val;
+      $i++;
     }
     $script[] = "};";
   }

